package cn.caplike.demo.repository.design.pattern.combined.annotation.dto;

import cn.caplike.demo.repository.design.pattern.combined.annotation.definition.ApiDataAdapter;
import cn.caplike.demo.repository.design.pattern.combined.annotation.definition.DeserializeDescriptor;
import cn.caplike.demo.repository.design.pattern.combined.annotation.definition.FinanceType;
import cn.caplike.demo.repository.design.pattern.combined.annotation.definition.FinanceVersion;
import lombok.*;

import java.util.List;

/**
 * 业务对象
 *
 * @author LiKe
 * @version 1.0.0
 * @date 2020-05-11 08:56
 */
@Data
@Builder
@NoArgsConstructor
@AllArgsConstructor
@EqualsAndHashCode(callSuper = true)
public final class Business extends DeserializeDescriptor {

    /**
     * 业务数据
     */
    @ApiDataAdapter(
            {
                    @ApiDataAdapter.Finance(type = FinanceType.TC, version = FinanceVersion.v20180907_TC, fieldName = "RequestBusinessData#TC-v20180907"),
                    @ApiDataAdapter.Finance(type = FinanceType.TY, version = FinanceVersion.v20190401_TY, fieldName = "RequestBusinessData#TY-v20190401")
            }
    )
    private RequestBusinessData businessData;

    /**
     * 经费数据
     */
    @ApiDataAdapter(
            {
                    @ApiDataAdapter.Finance(type = FinanceType.TC, version = FinanceVersion.v20180907_TC, fieldName = "RequestOutlayData#TC-v20180907"),
                    @ApiDataAdapter.Finance(type = FinanceType.TY, version = FinanceVersion.v20190401_TY, fieldName = "RequestOutlayData#TY-v20190401")
            }
    )
    @Singular(value = "outlayData")
    private List<RequestOutlayData> outlayData;

    /**
     * 资产数据
     */
    @ApiDataAdapter(
            {
                    @ApiDataAdapter.Finance(type = FinanceType.TC, version = FinanceVersion.v20180907_TC, fieldName = "RequestListData#TC-v20180907"),
                    @ApiDataAdapter.Finance(type = FinanceType.TY, version = FinanceVersion.v20190401_TY, fieldName = "RequestListData#TY-v20190401")
            }
    )
    @Singular(value = "requestListData")
    private List<RequestListData> requestListData;

}
